

var q1 = new Promise((resolve,reject)=>{
	let time = Math.random()*10000
	console.log("请求1将在 "+ time/1000.0 + "秒完成！")
	setTimeout(()=>{resolve("请求1完成了")},time)
})

var q2 = new Promise((resolve,reject)=>{
	let time = Math.random()*10000
	console.log("请求2将在 "+ time/1000.0 + "秒完成！")
	setTimeout(()=>{resolve("请求2完成了")},time)
})

var q3 = new Promise((resolve,reject)=>{
	let time = Math.random()*10000
	console.log("请求3将在 "+ time/1000.0 + "秒完成！")
	setTimeout(()=>{resolve("请求3完成了")},time)
})

var mixedPromiseArray = [q1,q2,q3]

var p = Promise.all(mixedPromiseArray)

p.then(values=>{
	console.log(values+"三个请求都完成啦！")	
}).catch(reason=>{
	console.log(reson)
})
